<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of PageController
 *
 * @author baonguyen
 */
class PageController extends BackController
{

    public $modelName = 'Page';

    public function init()
    {
        parent::init();
        $this->typeMyActiveForm = TRUE;
        $this->controllerMenu   = array();

        $this->controllerMenu[] = array(
            'label' => Yii::t('post', 'Post'),
            'url'   => $this->createUrl('post/index', array('lang' => $this->lang))
        );
    }

    public function save($action = 'Create')
    {
        $status = parent::save($action);
        if ($status)
        {
            $this->model->created_at = time();
            $this->model->save();
        }
        return $status;
    }

}
